package com.glsc.ngateway.common.api.platform.dto.system;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.List;

@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
public class ParamSystemVendorInfoDto {
    private Integer pageNo;
    private Integer pageSize;

    @ApiModelProperty(value = "主键")
    private Integer id;

    @ApiModelProperty(value = "供应商编码")
    private String vendorCode;

    @ApiModelProperty(value = "供应商联系人姓名")
    @Transient
    private List<String> vendorContractName;

    @ApiModelProperty(value = "供应商联系人id")
    @Transient
    private List<Integer> vendorContractId;

    @ApiModelProperty(value = "供应商联系人")
    @Transient
    private List<GwContactDto> vendorContract;

    @ApiModelProperty(value = "供应商名称")
    private String vendorName;

    @ApiModelProperty(value = "供应商联系方式")
    private String vendorContactInformation;

    @ApiModelProperty(value = "供应商手机号")
    private String vendorMobile;

    @ApiModelProperty(value = "供应商简介")
    private String briefIntro;

    @ApiModelProperty(value = "供应商地址")
    private String address;

    @ApiModelProperty(value = "信息描述")
    private String serviceInfo;

    @ApiModelProperty(value = "删除状态")
    private Integer deleted;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime insertTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime updateTime;

}
